<?php

namespace Database\Factories;

use App\Models\Order;
use App\Models\OrderEconomize;
use Illuminate\Database\Eloquent\Factories\Factory;

class OrderEconomizeFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = OrderEconomize::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'order_id' => $this->faker->randomElement(Order::pluck('id')),
            'user_id' => $this->faker->numberBetween(1, 50),
            'order_type' => $this->faker->randomElement([
                'onLine',
                'offLine',
            ]),
            'pay_price' => $this->faker->numberBetween(50, 200),
            'postage_price' => $this->faker->numberBetween(1, 30),
            'member_price' => $this->faker->numberBetween(1, 20),
            'offline_price' => $this->faker->numberBetween(1, 5),
            'coupon_price' => $this->faker->numberBetween(1, 10),
        ];
    }
}
